<template>
<!-- 幕后 -->
    <div class="tent-lists" v-if="sort.length">
        <h3>幕后文章<span class="iconfont icon-zuojiantou" @click="$router.go(-1)"></span></h3>
        <div class="main">
            <van-tabs v-model="activeName" color="#000" title-active-color="#000" background="#fff"
                title-inactive-color="#ccc" line-width="50PX" line-height="2px" :sticky="true" offset-top="58px" :animated="true"
                duration=".3">
                <van-tab v-for="ele in sort" :key="ele.cateid" :name="ele.catename">
                    <template #title>{{ele.catename}}
                        <i class="bar iconfont icon-shouye_shugang_shijiantixing"></i>
                    </template>
                    <lazy-component>
                    <whole v-if="ele.cateid==2" />
                    <lists :cateid="ele.cateid"/>
                    </lazy-component>
                </van-tab>
            </van-tabs>
        </div>
    </div>
</template>

<script>
    import {
        getCurtain
    } from "../api/behindTheScenes"
    import whole from "../components/behindTheScenes/whole.vue"
    import lists from "../components/behindTheScenes/lists.vue"
    export default {
          name:'BehindTheScenes',
        components: {
            whole,
            lists
        },
        data() {
            return {
                sort: [],
                activeName: '全部'
            }
        },
        created() {
            getCurtain().then(data => {
                this.sort = data.data;
                console.log(this.sort);
            })
        }
    }
</script>

<style lang="less">
    .tent-lists {
        padding-top: 58px;

        h3 {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 1;
            text-align: center;
            line-height: 58px;
            font-size: 14px;
            color: #fff;
            background-color: #000;

            span {
                position: absolute;
                left: 22px;
            }
        }

        .van-tabs {
            .van-tabs__line {
                border-radius: 0;
            }

            .van-tab {
                font-size: 12px;

                .bar {
                    position: absolute;
                    right: -7px;
                    color: #ccc;
                }
            }
        }
    }
</style>